$(".handleMarked").click(function(){
	//first do the action
	params =  "module=add_courses&action="+ $(this).attr("id")+"&"+ $("#mngForm").serialize();
	$.post("handleMarked", params,function(data){
		//making it work with FF......
		var serializer = new XMLSerializer();
		var xml = serializer.serializeToString(data);
		data = xml.replace("<firefoxsucks>","").replace("</firefoxsucks>","");
		//real begining fo function
		if(data != "success"){
			//reload content
		    alert("Operation failed!");  
		}else{
			$("#contenttext").load('contents/courses.jsp');
		}

	});
});

$("#AJAXsearchBox").keyup(function(){
	$("#CoursesDiv").load("contents/search_courses.jsp",$("#mngForm").serialize());
});

$("#srchDB").click(function(){
	checkboxes = document.mngForm.srchOptions;
	if(this.checked){
		for(i = 0; i < checkboxes.length; i++){
			checkboxes[i].disabled = true;
		}
		document.mngForm.AJAXsearchBox.value = "";
		$("#AJAXsearchBox").css('display','block');
		$("#searchBox").css('display','none');
	}else{
		for(i = 0; i < checkboxes.length; i++){
			checkboxes[i].disabled = false;
		}
		document.mngForm.AJAXsearchBox.value = "";
		$("#searchBox").css('display','block');
		$("#AJAXsearchBox").css('display','none');
	}
});


